Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs https://github.com/keep-network/tbtc-v2/blob/5c2ec02226761ab4ddee3a5c773fef6346f02003/docs/rfc/rfc-10.adoc#rfc-9-solana-tbtc
This PR aims to draft functionality for direct cross-chain deposits and redemption of TBTC. The first couple of commits revolve around the Base chain for simplicity and just show how the dots might be connected. However, the flow should be very similar for other EVM and non-EVM chains. More generic implementation should be considered in further commits to lay the ground for other chains.
Here are the building blocks:
cross-chain/base/BaseGateway.sol
This contract is deployed on the Base chain and triggers the on-chain flow for reveal and redemption functionality.BaseGateway
calls Automatic Wormhole Relayer contract to facilitate the delivery of Verifiable Action Approvals (VAAs) to recipient contracts. Addresses of the Relayer contract for the Base chain can be found hereOff-chain Wormhole Guardian Network that calls
receiveWormholeMessages()
on the receiving end.solidity/cross-chain/BaseDepositor.sol
- this contract is deployed on Ethereum and it receives the reveal params from L2 and then triggers the tBTCbridge.reveal()
flowsolidity/cross-chain/BaseRedeemer.sol
- this contract is deployed on Ethereum and it receives the redemption params from L2 and then triggers the tBTCbridge.requestRedemption()
flowtBTC relayer / bot
To make a seamless user experience there should be implemented a tTBC relayer that listens to on-chain events and acts accordingly.Once the reveal flow is complete and TBTC is minted on Ethereum, then the
tBTC relayer
can trigger the same flow as is available in the Wormhole Portal. With a minted TBTC on Ethereum it can call the existingL2WormholeGateway.receiveTbtc()
available on Base. TBTC on Ethereum will be locked and the canonical TBTC will be minted on Base for a user who initiated BTC bridging.When going back from L2->L1 (e.g. redemption flow) the
L2WormholeGateway.sendTbtc()
should be called on Base. TheBaseRedeemer.sol
should trigger thetTBTC
redemption flow.